package demo1;



abstract class Shape{
    public abstract void draw();
}
class Rect extends Shape {
    public void draw() {
        System.out.println("矩形");//子类为抽象父类初始化变量方法
    }
}
public class J2410242 {
        public static void func(Shape shape){
            shape.draw();
        }

        public static void main(String[] args) {
            Shape shape = new Rect();
            func(new Rect());

    }
}
